#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
#include<string.h>
int main()
{
	char ch[80];
	int i = 0;
	int j = 0;
	gets(ch);
	int len = strlen(ch);
	for (i = 0; i < len; i++)
	{
		if (ch[i] >= 'a' && ch[i] <= 'z')
			ch[i] -= 32;
		else if (ch[i] >= 'A' && ch[i] <= 'Z')
			ch[i] += 32;
	}
	printf("%s\n", ch);
	return 0;
}